<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('假期配置类型列表')" />
</head>
<body class="gray-bg">
    <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:holiday:type:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:holiday:type:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>

    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('erp:holiday:type:edit')}]];
        var removeFlag = [[${@permission.hasPermi('erp:holiday:type:remove')}]];
        var removeFlag = [[${@permission.hasPermi('erp:holiday:view')}]];
        var prefix = ctx + "erp/holiday/type";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                showToggle: false,
                showSearch: false,
                showColumns: false,
                showRefresh: false,
                modalName: "假期配置类型",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'id',
                        title: '',
                        visible: false
                    },
                    {
                        field: 'title',
                        title: '标题'
                    },
                    {
                        field: 'createBy',
                        title: '创建人'
                    },
                    {
                        field: 'createTime',
                        title: '创建时间'
                    },
                    {
                        field: 'descritpion',
                        title: '描述'
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            var openUrl = "/erp/holiday/"+ row.id
                            actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.title + ' 列表\',\'' + openUrl + '\')"><i class="fa fa-list-ul"></i>列表</a> ');
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                            return actions.join('');
                        }
                    }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>